<%@ page import="com.dingpeikeji.quickdeer.core.modules.sys.entity.Office" contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<c:set var="FLAT_TYPE_ENTERPRISE" value="<%=Office.FLAT_TYPE_ENTERPRISE %>" />
<html>
<head>
	<title>用户结算管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/rentproduct/settle/list">用户结算</a></li>
	</ul>
	<form:form id="searchForm" modelAttribute="payinfo" action="${ctx}/rentproduct/settle/list" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<div>
			<label>合作伙伴：</label>
			<sys:treeselect id="office" name="orders.office.id" value="${payinfo.orders.office.id}" labelName="orders.office.name" labelValue="${payinfo.orders.office.name}"
				title="合作伙伴" url="/sys/office/treeData?type=2&flatType=${FLAT_TYPE_ENTERPRISE }" cssClass="input-small" allowClear="true" notAllowSelectParent="true"/>
			<label>日期范围</label>
			<input name="createDateStart" type="text" readonly="readonly" maxlength="20" class="input-mini Wdate"
				value="${payinfo.createDateStart }" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
			至
			<input name="createDateEnd" type="text" readonly="readonly" maxlength="20" class="input-mini Wdate"
				value="${payinfo.createDateEnd }" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true});"/>
			<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
		</div>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>合作伙伴</th>
				<th>应付日期</th>
				<th>订单金额</th>
				<th>支付类型</th>
				<shiro:hasPermission name="rentproduct:settle:edit">
					<th>操作</th>
				</shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="payinfo">
			<tr>
				<td>${payinfo.orders.office.name}</td>
				<td><fmt:formatDate value="${payinfo.createDate}" pattern="yyyy-MM-dd"/></td>
				<td>￥${payinfo.payfee }</td>
				<td>${payinfo.discounttype }</td>
				<shiro:hasPermission name="rentproduct:settle:edit">
					<td>
						<a href="${ctx}/rentproduct/settle/receive?discountid=${payinfo.discountid}" onclick="return confirmx('确认收款？', this.href)">结算</a>
					</td>
				</shiro:hasPermission>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>